import type { ImageResponseOptions } from 'next/dist/compiled/@vercel/og/types'; import { ImageResponse } from 'next/og'; import type { ReactElement } from 'react'; interface GenerateProps { title: string; description?: string; } export function generateOGImage( options: GenerateProps & ImageResponseOptions, ): ImageResponse { const { title, description, ...rest } = options; return new ImageResponse( generate({ title, description, }), { width: 1200, height: 630, ...rest, }, ); } export function generate({ title, description = 'Learn more about this post by visiting the website.', }: GenerateProps): ReactElement { return (